home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
wb
/
czesc_4
/
vark15
/
utils a-o
/
dd1066.lha
/
DunderDir
/
Sources
/
WildChange.asm
< prev
next >
Wrap
Assembly Source File
|
1996-04-30
|
2KB
|
105 lines
******
**
** This source is Public Domain. Do what you want
** with it. But you may not change it and keep it
** with the DunderDir archive :(
**
** This was assembled with ASM-One but should
** work with almost any assembler :)
**
******
**
** Exec offsets
**
_LVOOldOpenLibrary = -408
_LVOCloseLibrary = -414
********
**
** DOS offsets
_LVOPutStr = -948
********
**
** Some stuff in _DOSBase
dl_Root = 34
rn_Flags = 52
RNB_WILDSTAR = 24
********
**
_AbsExecBase = 4
**
********
** Made these macros because i'm so lazy :)
**
jsrb MACRO
jsr _LVO\1(a6)
ENDM
Print MACRO
lea \1(pc),a0
move.l a0,d1
jsrb PutStr
ENDM
*** Start
movea.l a0,a2 * Save argument
lea dosname(pc),a1
movea.l _AbsExecBase.w,a6
jsrb OldOpenLibrary
movea.l d0,a6
bne.s gotdos
moveq #20,d0 * failure
rts
gotdos: Print hellotxt
cmpi.b #'?',(a2) * print args?
bne.s noshow
Print argstxt
bra.s exit
noshow: movea.l dl_Root(a6),a3
cmpi.b #'-',(a2)+
bne.s toggle
ori.b #$20,(a2) * make letter small
cmpi.b #'o',(a2) * set?
bne.s not_o
wason: Print ontxt
bset #RNB_WILDSTAR,rn_Flags(a3)
bra.s exit
not_o: cmpi.b #'f',(a2) * unset?
bne.s toggle
wasoff: Print offtxt
bclr #RNB_WILDSTAR,rn_Flags(a3)
bra.s exit
toggle: bchg #RNB_WILDSTAR,rn_Flags(a3)
btst #RNB_WILDSTAR,rn_Flags(a3)
beq.s wasoff
bra.s wason
exit: movea.l _AbsExecBase.w,a1
exg.l a1,a6
jsrb CloseLibrary
moveq #0,d0 * return ok.
rts * exit
dc.b '$VER: WildChange 1.00 (13-May-95)',0
dosname: dc.b 'dos.library',0
hellotxt: dc.b 'WildChange © 1995 Jimmie Matsson, '
dc.b 'All Rights Reserved.',$a
dc.b 'Not for commersial usage.',$a,$a,0
argstxt: dc.b 'Usage: WildChange [-o | -f | -t]',$a,$a
dc.b ' -o Turn wildstar on',$a
dc.b ' -f Turn wildstar off',$a
dc.b ' -t Toggle wildstar',$a,$a
dc.b 'Options are case-insensitive. '
dc.b 'Default option is -t(Toggle).',$a
dc.b 'If the option is unknown, then -t(Toggle) '
dc.b 'will be used.',$a,$a,0
ontxt: dc.b 'WildStar is ON',$a,0
offtxt: dc.b 'WildStar is OFF',$a,0